package cn.itcast.myapplication.fragment;

import android.os.Bundle;

import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import cn.itcast.myapplication.R;
import cn.itcast.myapplication.databinding.FragmentBlankBinding;
import cn.itcast.myapplication.databinding.FragmentMasterBinding;
import cn.itcast.myapplication.viewemodel.NavViewModel;


public class BlankFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        NavViewModel navViewModel;
        navViewModel=new ViewModelProvider(getActivity()).get(NavViewModel.class);
        FragmentBlankBinding binding;
        binding= DataBindingUtil.inflate(inflater,R.layout.fragment_blank,container,false);
        binding.setData(navViewModel);
        binding.setLifecycleOwner(getActivity());
        binding.button11.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                NavController navController= Navigation.findNavController(view);
                navController.navigate(R.id.action_blankFragment_to_masterFragment);
            }
        });

        // Inflate the layout for this fragment
        return binding.getRoot();


    }
}